﻿using System;
using System.Collections.Generic;
using System.Data.Objects;
using System.Linq;
using System.Web;

namespace BooksOnline.Serivces
{
    public class AuthenticationService
    {
        public UserRole ValidateUser(string userName, string password)
        {
            BooksOnlineModelContainer container = new BooksOnlineModelContainer();
             
            var user = (from userRole in container.UserRoles
                             where userRole.User.Name == userName && userRole.User.Password == password
                             select userRole).First();

            return user;
        }
    }
}